<template>
	<div id="entries_container">
		<a href="http://wengine.zhedacxz.com/app/index.php?i=2&c=entry&do=list_dui&m=bsht_tbk&openid=" class="entry">
			<div class="fl">
				<img :src="collect">
				礼品兑换
			</div>
		</a>
		<router-link class="entry" :to="e.path" v-for="(e,i) in entries"
			:key="i"
            v-show="!(user.level==2 && (e.name==='update' || e.name==='autoUpdate'))">
			<div class="fl">
				<img :src="e.img">
				{{e.title}}<span class="c-txt">{{e.des}}</span>
			</div>
			<div class="fr c-txt">
				<div v-if="e.name==='member'">{{memberNum}}人</div>
				<div v-if="e.name==='balance'">{{moneyData.wukong}}积分</div>
			</div>
		</router-link>
	</div>
</template>
<script>
import balance from '@/assets/img/user/balance.png'
import integral from '@/assets/img/user/integral.png'
import manage from '@/assets/img/user/manage.png'
import record from '@/assets/img/user/record.png'
import rule from '@/assets/img/user/rule.png'
import sharing from '@/assets/img/user/sharing.png'
import collect from '@/assets/img/user/collect.png'
import { mapGetters, mapActions } from 'vuex'
export default{
	name:'Entries',
	created(){
		this.getMembers()
	},
	data(){
		return{
			collect
		}
	},
	computed:{
		...mapGetters({
			moneyData: 'moneyData',
			memberNum: 'member/memberNum',
			user: 'user/userInfo'
		}),
		entries(){
			return[{
				title: '账户积分',
				des: '（可提取）',
				img: balance,
				name: 'balance',
				path:'/user/drawMoney'
			},
			// {
			// 	title: '升级创享会员',
			// 	img: collect,
			// 	name: 'update',
			// 	path:'/order/buyMembership'
			// },
			// {
			// 	title: '自助升级会员',
			// 	img: integral,
			// 	name: 'autoUpdate',
			// 	path:'/user/askMembership'
			// },
			{
				title: '会员收益',
				des: '',
				img: rule,
				name: 'revenue',
				path:'/user/rule'
			},{
				title: '会员管理',
				des: '',
				img: manage,
				name: 'member',
				path:'/user/member'
			},{
				title: '收益明细',
				des: '',
				img: record,
				name: 'collect',
				path:'/user/revenueDetail'
			}]
		}
	},
	methods:{
		...mapActions({
			getMembers: 'member/getMembers',
			getMoneyOverview: 'getMoneyOverview'
		})
	}
}
</script>
<style lang='less' scoped>
	#entries_container{
		margin-top: .2rem;
	}
	.entry{
		width: 100%;
		padding: 0 .4rem;
		height: 1.33rem;
		line-height: 1.33rem;
		background: #fff;
		border-bottom: 1px solid #eee;
		font-size: .4rem;
		display: inline-table;
		vertical-align: middle;
		background-image: url(../../assets/img/common/more.png);
		background-repeat: no-repeat;
		background-position: 9.4rem;
		padding-right: .8rem;
		img{
			vertical-align: middle;
			margin-right: .2rem;
		}
	}
</style>
